package com.xwdeshj.service;

import com.alibaba.fastjson.JSONObject;
import com.xwdeshj.entity.XwUserinfo;
import com.xwdeshj.result.IMoocJSONResult;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created by BKWJA on 2018/11/19.
 */
public interface XwUserinfoService {

    /**
     * 登录
     */
    public IMoocJSONResult login(String username,String password,HttpServletResponse response);

    /**
     * 强制更换密码
     */
    public JSONObject forceModifyPassword(String userEncryptid,String oldPwd,String newPwd);

    /**
     * 添加用户、注册用户
     * @return
     */
    public IMoocJSONResult addsave(String username,String userTel,String userRealname,String userAvatar,
                                   String userSex,String user_role,String password,String email,
                                   HttpServletRequest request);

    /**
     * 查询
     * @return
     */
    public JSONObject querUserList(Integer pagesize, Integer pageindex, String starttime, String endtime, String searchval,
                                   String searchkey, String sortfild, String sortway,String user_role);

    /**
     * 根据id，获取该用户的个人信息
     */
    public IMoocJSONResult userInformation(String user_encryptId,HttpServletRequest request);

    //修改用户基本资料
    public JSONObject updateInformation(String user_encryptId,String user_realName,String user_role,
                                        String user_tel,String user_mail,String user_Avatar,String user_password,
                                        String user_sex,String farm_encryptId,String sec_encryptId,
                                        HttpServletRequest request);

    /**
     * 删除用户信息，如果是商家，同时删除商家的所有信息
     */
    JSONObject delInformation(String user_encryptId,String farm_encryptId,String sec_encryptId,
                              HttpServletRequest request);

    /**
     * 搜索用户
     */
    JSONObject userquery(String field, String value, HttpServletRequest request, HttpServletResponse response);

    /**
     * 删除商家基本信息,用于解决jpa方法的先后顺序
     */
    JSONObject delbusinessinfo(String business_encryptId,String farm_encryptId,String sec_encryptId,
                               HttpServletRequest request);

    JSONObject getUserOne(String user_encryptId,HttpServletRequest request);

    JSONObject modifyUserRemarks(String user_encryptId, String themeRemarks,
                                 String playRemarks,HttpServletRequest request);


    JSONObject updateUserinfo(String user_encryptId,String updatefiled,String updateval,
                              HttpServletRequest request);

    JSONObject getuidBusinessType(String user_encryptid,String user_role,
                               String userid,HttpServletRequest request);

    JSONObject checkUsername(String username,HttpServletRequest request);

    JSONObject checkUsertel(String tel,HttpServletRequest request);

}
